<?php 
require_once 'include.php';
$id=$_REQUEST['id'];
$proInfo=getProById($id);
$proImgs=getProImgsById($id);
if(!($proImgs &&is_array($proImgs))){
	alertMes("商品图片错误", "index.php");
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>商品介绍</title>
<link type="text/css" rel="stylesheet" href="styles/reset.css">
<link type="text/css" rel="stylesheet" href="styles/main.css">
<link type="text/css" rel="stylesheet" media="all" href="styles/jquery.jqzoom.css"/>
<script type="text/javascript" src="js/goodsdetail.js" charset="gb2312"></script>
<script src="js/jquery-1.6.js" type="text/javascript"></script>
<script src="js/jquery.jqzoom-core.js" type="text/javascript"></script>
<!--[if IE 6]>
<script type="text/javascript" src="js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript" src="js/ie6Fixpng.js"></script>
<![endif]-->
<script type="text/javascript">
$(document).ready(function() {
	$('.jqzoom').jqzoom({
            zoomType: 'standard',
            lens:true,
            preloadImages: false,
            alwaysOn:false,
			title:false,
			zoomWidth:410,
			zoomHeight:410
        });
	
});
window.onload = function(){
	tabs('right1','mouseover');
} 
</script>
</head>

<body class="grey">
<?php include('header.php');?>
<div class="userPosition comWidth">
	<strong><a href="index.php">首页</a></strong>
	<span>&nbsp;&gt;&nbsp;</span>
	<a href="#"><?php echo $proInfo['cName'];?></a>
	<span>&nbsp;&gt;&nbsp;</span>
	<em><?php echo $proInfo['pSn'];?></em>
</div>
<div class="description_info comWidth">
	<div class="description clearfix">
		<div class="leftArea">
			<div class="description_imgs">
				<div class="big">
					<a href="image_800/<?php echo  $proImgs[0]['albumPath'];?>" class="jqzoom" rel='gal1'  title="triumph" >
           			 <img width="309" height="340" src="image_350/<?php  echo $proImgs[0]['albumPath'];?>"  title="triumph">
	        		</a>
				</div>
				<ul class="des_smimg clearfix" id="thumblist" >
					<?php foreach($proImgs as $key=>$proImg):?>
					<li><a class="<?php echo $key==0?"zoomThumbActive":"";?> active" href='javascript:void(0);' rel="{gallery: 'gal1', smallimage: 'image_350/<?php echo $proImg['albumPath'];?>',largeimage: 'image_800/<?php echo $proImg['albumPath'];?>'}"><img src="image_50/<?php echo $proImg['albumPath'];?>" alt=""></a></li>
					<?php endforeach;?>
				</ul>
			</div>
		</div>
		<div class="rightArea">
			<div class="des_content">
				<h3 class="des_content_tit"><?php echo $proInfo['pName'];?></h3>
				<div class="dl clearfix">
					<div class="dt">淘淘乐价</div>
					<div class="dd clearfix"><span class="des_money" id="price" ><em>￥</em><?php echo $proInfo['iPrice'];?></span></div>
				</div>
				<div class="dl clearfix">
					<div class="dt">优惠</div>
					<div class="dd clearfix"><span class="hg"><i class="hg_icon">满换购</i><em>购ipad加价优惠够配件或USB充电插座</em></span></div>
				</div>
				<div class="des_position">
<!-- 					<div class="dl clearfix">
						<div class="dt">送到</div>
						<div class="dd clearfix">
							<div class="select">
								<h3>海淀区五环内</h3><span></span>
								<ul class="show_select">
									<li>上帝</li>
									<li>五道口</li>
									<li>上帝</li>
								</ul>
							</div>
							<span class="theGoods">有货，可当日出货</span>
						</div>
					</div> -->
<!-- 					<div class="dl clearfix"> -->
<!-- 						<div class="dt des_select_more">选择版本</div> -->
<!-- 						<div class="dd clearfix "> -->
<!-- 							<div class="des_item des_item_sm des_item_acitve"> -->
<!-- 								<input type="radio" name="select_edition" value="2" />WIFI 16GB -->
<!-- 							</div> -->
<!-- 							<div class="des_item des_item_sm"> -->
<!-- 								<input type="radio" name="select_edition" value="2" />WIFI 16GB + 3G -->
<!-- 							</div> -->
<!-- 							<div class="des_item des_item_sm"> -->
<!-- 								<input type="radio" name="select_edition" value="2" />WIFI + 3G -->
<!-- 							</div> -->
<!-- 							<div class="des_item des_item_sm"> -->
<!-- 								<input type="radio" name="select_edition" value="2" />WIFI 16GB -->
<!-- 							</div> -->
<!-- 						</div> -->
<!-- 					</div> -->
					<div class="dl">
						<div class="dt des_num">数量</div>
						<div class="dd clearfix">
							<div class="des_number">
								<a href="javascript:numDes();"><div class="reduction">-</div></a>
								<div class="des_input">
									<input type="text" name="number" id="number" value="1">
								</div>
								<a href="javascript:numPlus();"><div class="plus">+</div></a>
							</div>
							<span class="xg">限购<em><?php echo $proInfo['pNum']?></em>件</span>
						</div>
					</div>
				</div>
				<div class="des_select">
					已选择 <span>"白色|WIFI 16G"</span>
				</div>
				<div class="shop_buy">
					<a href="javascript:addCart(<?php echo $proInfo['id']?>);" class="shopping_btn"></a>
					<span class="line"></span>
					<a href="javascript:buyNow(<?php echo $proInfo['id']?>);" class="buy_btn"></a>
				</div>
				<script>
					function addCart(productid){
						var url="doAction.php?act=addCart";
						var data={"productid":productid,"num":parseInt($("#number").val()),"price":<?php echo $proInfo['iPrice']?>};
						var success=function(response){
    							if(response.errno==0){
    						        alert("加入购物车成功");
    						    }else if(response.errno==-2){
    						        alert("请先登陆");
    						    }else{
    						    	alert("加入购物车失败");
    						    }
							}
						$.post(url,data,success,"json");
					}
					function buyNow(productid){
						var url="doAction.php?act=addCart";
						var data={"productid":productid,"num":parseInt($("#number").val()),"price":<?php echo $proInfo['iPrice']?>};
						var success=function(response){
    							if(response.errno==-1){
    								alert("购买失败");
    						    }else if(response.errno==-2){
    						        alert("请先登陆");
    						    }else{
        						    window.location="cart.php";
    						    }
							}
						$.post(url,data,success,"json");
					}
					function numPlus(){
						$num=parseInt($("#number").val());
						if($num<<?php echo $proInfo['pNum']?>)$("#number").val($num+1);
					}
					function numDes(){
						$num=parseInt($("#number").val());
						if($num>1) $("#number").val($num-1);
					}
				</script>
				<div class="notes">
					注意：此商品可提供普通发票，不提供增值税发票。
				</div>
			</div>
		</div>
	</div>
</div>
<div class="hr_15"></div>
<div class="des_info comWidth clearfix">
	<div class="leftArea">
		<div class="recommend">
			<h3 class="tit">同价位</h3>
			<div class="item">
				<div class="item_cont">
					<div class="img_item">
						<a href="#"><img src="images/shopImg.jpg" alt=""></a>
					</div>
					<p><a href="#">文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍</a></p>
					<p class="money">￥888</p>
				</div>
			</div>
			<div class="item">
				<div class="item_cont">
					<div class="img_item">
						<a href="#"><img src="images/shopImg.jpg" alt=""></a>
					</div>
					<p><a href="#">文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍</a></p>
					<p class="money">￥888</p>
				</div>
			</div>
			<div class="item">
				<div class="item_cont">
					<div class="img_item">
						<a href="#"><img src="images/shopImg.jpg" alt=""></a>
					</div>
					<p><a href="#">文字介绍文字介绍文字介绍文字介绍文字介绍文字介绍</a></p>
					<p class="money">￥888</p>
				</div>
			</div>
		</div>
		<div class="hr_15"></div>
	</div>
	<div class="rightArea" id="right1">
		<ul class="des_tit">
			<li href="javascript:;" class="active"><span>商品介绍</span></li>
			<li href="javascript:;"><span>商品评价(12312)</span></li>
		</ul>
		<div class="des_infoContent">
			<div class="ad">
				<a href="#"><img src="images/ad.jpg"></a>
			</div>
			<div class="info_text">
				<?php echo $proInfo['pDesc'];?>
			</div>
		</div>
		<div class="hr_15"></div>
		<div class="des_infoContent hide">
			<h3 class="shopDes_tit">商品评价</h3>
			<div class="score_box clearfix">
				<div class="score">
					<span>4.7</span><em>分</em>
				</div>
				<div class="score_speed">
					<ul class="score_speed_text">
						<li class="speed_01">非常不满意</li>
						<li class="speed_02">不满意</li>
						<li class="speed_03">一般</li>
						<li class="speed_04">满意</li>
						<li>非常满意</li>
					</ul>
					<div class="score_num">
						4.7<i></i>
					</div>
					<p>共18939位网友参与评分</p>
				</div>
			</div>
			<div class="review_tab">
				<ul class="review fl">
					<li><a href="#" class="active">全部</a></li>
					<li><a href="#">满意（3121）</a></li>
					<li><a href="#">一般（321）</a></li>
					<li><a href="#">不满意（1121）</a></li>
				</ul>
				<div class="review_sort fr">
					<a href="#" class="review_time">时间排序</a><a href="#" class="review_reco">推荐排序</a>
				</div>
			</div>
			<div class="review_listBox">
				<div class="review_list clearfix">
					<div class="review_userHead fl">
						<div class="review_user">
							<img src="images/userhead.jpg" alt="">
							<p>61***42</p>
							<p>金色会员</p>
						</div>
					</div>
					<div class="review_cont">
						<div class="review_t clearfix">
							<div class="starsBox fl"><span class="stars"></span><span class="stars"></span><span class="stars"></span><span class="stars"></span><span class="stars"></span></div>
							<span class="stars_text fl">5分 满意</span>
						</div>
						<p>挺不错的信赖挺不错的，信赖</p>
						<p><a href="#" class="ding">顶(0)</a><a href="#" class="cai">踩(0)</a></p>
					</div>
				</div>
				<div class="review_list clearfix">
					<div class="review_userHead fl">
						<div class="review_user">
							<img src="images/userhead.jpg" alt="">
							<p>61***42</p>
							<p>金色会员</p>
						</div>
					</div>
					<div class="review_cont">
						<div class="review_t clearfix">
							<div class="starsBox fl"><span class="stars"></span><span class="stars"></span><span class="stars"></span><span class="stars"></span><span class="stars"></span></div>
							<span class="stars_text fl">5分 满意</span>
						</div>
						<p>挺不错的信赖挺不错的，信赖</p>
						<p><a href="#" class="ding">顶(0)</a><a href="#" class="cai">踩(0)</a></p>
					</div>
				</div>
				<div class="hr_25"></div>
			</div>
		</div>
	</div>
</div>
<div class="hr_25"></div>
<?php include('footer.php');?>
</body>
</html>

